<!DOCTYPE html>
<html>
    <head>
        <title>less+seajs+backbone</title>
        <meta http-equiv=Content-Type content="text/html" charset='utf-8'>
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
        <link type="text/less" rel="stylesheet" href="public/resource/css/main.less">
        <script type="text/javascript" src="public/components/seajs/2.3.0/seajs.js"></script>
        <script type="text/javascript">
           
            //全局配置   http://dev.cmd.com/dev.html
            var $domain = window.location.origin,
                $Share = {}, $Util = {}, $Lang = {},
                $Global = {
                    client : 'cmd',
                    domain : $domain,
                    publicUrl : $domain+'/public',
                    apiUrl : $domain+'/apis/',
                    router : $domain+'/router', 
                    controller : $domain+'/controllers', 
                    view : $domain+'/views', 
                    model : $domain+'/models', 
                    currentModule : 'index',
                    cacheModule : {},
                };

                seajs.config({

                    alias: {
                        "lang" : $Global.publicUrl+"/i18n/zh",
                        "zepto": $Global.publicUrl+"/components/zepto/zepto",
                        "util": "util/util.js",
                        "share": "share.js",
                        "util": $Global.publicUrl+"/components/util/util",
                        "backbone": $Global.publicUrl+"/components/backbone/backbone.js",
                        "underscore": $Global.publicUrl+"/components/underscore/underscore.js",
                        "less" : $Global.publicUrl+"/components/less/dist/less",
                    },

                    preload: [], //需要插件支持

                    paths: {},

                    vars: {
                        'publicUrl': $Global.publicUrl,          
                        'router' : $Global.router,
                        'controller' : $Global.controller,
                        'view': $Global.view,
                        'model': $Global.model,
                        'apiUrl': $Global.apiUrl,
                    },

                    'map': [
                            //[/^(.*\.(?:css|js|tpl))(.*)$/i, '$1?v='+Math.random()]    
                            [/^(.*\.(?:css|js|tpl))(.*)$/i, '$1?v=1.0']
                    ],

                    debug: true, //需要插件支持

                    base: '/',

                    charset: 'utf-8'
                });

                seajs.use(['backbone','util','share','lang','less'],function(backbone,util,share,lang){
                    $Util = util; $Share = share; $Lang = lang;
                    seajs.use("main");
                });  

                 
        </script>
    </head>
    <body>
      <div id='moduleBox'></div>
 
    </body>
</html>


